from fastapi import APIRouter
from src.huey_init.storages import Storage
from src.translation_file.datamodel import TranModel
from src.translation_file.tasks import run_translation_task

router = APIRouter(
    prefix="/translation",
    tags=["translation"],
    responses={404: {"description": "Not found"}},
)
# 翻译任务入口
@router.post("/translate_file")
async def translation(tran_model: TranModel):
    res = run_translation_task(tran_model)
    task_id = res.id
    return {"status": "success", "aitask_id": task_id}




